<%
String status = "";
if(request.getSession().getAttribute("status") != null){
	status = (String)request.getSession().getAttribute("status");
}else if(!status.equals("ingelogd")){
	response.sendRedirect("../index.jsp?message=Log+eerst+in+om+verder+te+gaan");
}
//session.removeAttribute("status");
%>
<%@page import="model.*" %>
<%@page import="domein.*" %>
<% int eventID = Integer.parseInt(request.getParameter("eventID")); 
	EvenementenIO eIo = new EvenementenIO();
	Evenement e = eIo.getEvent(eventID);
	ProgrammaIO pIo = new ProgrammaIO();
	Programma p = pIo.getProgramma(e.getProgrammaID());
	LocatieIO lIo = new LocatieIO(); 
	String locatie = "";
	int id = e.getLocatieID();
	for(Locatie l : lIo.listLocaties()){
		if(l.getLocatieID() == id)
			locatie = l.getAdres()+" "+l.getPlaats();
	}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">

<head>
<title>Incentro Event Inviting System</title> 
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="../style.css" />

</head>

<body onload="initialize()" onunload="GUnload()">

	<div id="wrapper">
		<div id="header">
			<a href="../eOverzicht.jsp" id="logo"><img src="../img/logo.png" /></a>
		</div>
		
		<h3>Details aanpassen - <%out.print(e.getNaam()); %></h3>
		
		<div id="search-form">
			<a href="javascript:javascript:history.go(-1)"><input type="submit" value="Terug" class="terugButton" /></a>
			
		</div>
			
		<form id="eventForm" action="../EventAanpassen.do" method="get" >
			<div class=" child2 uOpstellenArea1">				
				<span> 
				<label for="contactpersoon">Contactpersoon</label> 
					<select name="contactpersoon">
					<% 
					GebruikersIO gIo = new GebruikersIO();
						for(Gebruiker g : gIo.listGebruikers()){
					%>
						<option value="<%out.print(g.getEmail());%>"><%out.print(g.getVoornaam() +" "+g.getAchternaam()); %></option>
						<%} %>
					</select> 
				</span>
				
				<br /></br>
				<span> 
					<label for="naam">Titel event</label> <input type="text" id="naam" name="naam" value="<%out.print(e.getNaam());%>"/>
				</span>
				
				<span> 
					<label for="naam">Subtitel</label> <input type="text" id="subTitel" name="subTitel" value="<%out.print(e.getSubtitel());%>"  />
				</span>
				 
				<span> 
					<label for="datum">Datum</label> <input type="date" name="datum" id="datum" value="<%out.print(e.getDatum()); %>" />
				</span>				 
				 
				 <span> 
					<label for="organisator">Organisator</label> <input type="text" name="organisator" id="organisator" value="<%out.print(e.getOrganisator());%>" />
				</span>
				 
				<span> 
				<label for="locatie">Locatie</label> 
					<select name="locatie"><option value="<%out.print(locatie); %>"><%out.print(locatie); %></option>
<%
						for(Locatie l : lIo.listLocaties()){
					%>
						<option value="<%out.print(l.getLocatieID());%>"><%out.print(l.getAdres()+", "+l.getPlaats()); %></option>
						<%} %>
					</select> 
				</span>
			</div>

		<!--  <div id="uOpstellenArea3">
			
	
			    
		</div> -->	
		
					
			<input type="submit" value="Pas aan" id="form_submit1" />
			<input type="hidden" name="eventID" id="eventID" value="<%out.print(eventID); %>" />
		
		</form>		
	</div>
</body>

</html>